package com.wjjun.basemvpvm.data.response;

import com.google.gson.annotations.SerializedName;

/**
 * 基础的response类
 * author Wjjun
 * Created 2018/3/20.
 */

public class BaseResponse<E> {

    @SerializedName("Success")
    protected boolean success;

    @SerializedName("ErrorCode")
    protected int errorCode;

    @SerializedName("Message")
    protected String message;

    @SerializedName("Data")
    protected E data;

    @SerializedName("PageIndex")
    protected int pageIndex = -1;

    @SerializedName("PageSize")
    protected int pageSize = 0;

    @SerializedName("TotalPage")
    protected int totalPage = 0;

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public E getEntity() {
        return data;
    }

    public E getData() {
        return data;
    }

    public void setData(E data) {
        this.data = data;
    }

    public int getPageIndex() {
        return pageIndex;
    }

    public void setPageIndex(int pageIndex) {
        this.pageIndex = pageIndex;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }
}
